<?php 
require_once ("../../../../init.php");
$pageSize=15;
$test_title   = !empty($_REQUEST['query'])&&($_REQUEST['query']!="?")&&($_REQUEST['query']!="？") ? trim($_REQUEST['query']) : "";
$condition=array();
if (!empty($test_title)){
    $condition["test_title"]=" like '%$test_title%'";
}
$start=0;
if (isset($_REQUEST['start'])){
    $start=$_REQUEST['start']+1;
}
$limit=$pageSize;
if (isset($_REQUEST['limit'])){
    $limit=$_REQUEST['limit'];
    $limit= $start+$limit-1;
}
$condition = conditionByCompany($condition);
$arr['totalCount']= Test::count($condition);
$arr['tests']    = Test::queryPage($start,$limit,$condition);
echo json_encode($arr);
?>
